<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function getsum() {
            var sum = 0;
            for (var i = 0; i <= 100; i++) {
                sum += i;
            }
            console.log(sum);
        }
        getsum();

        function getsums(nm1, nm2) {
            var sum = 0;
            for (var i = nm1; i <= nm2; i++) {
                sum += i;
            }
            return sum;
        }
        getsums(1, 3);
        console.log(getsums(1, 3));

        function getresult() {
            return 666;
        }
        getresult();
        console.log(getresult());
    </script>
</head>

<body>

</body>

</html>